from flask import Flask, jsonify, render_template
from handle.anaylse import *

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/boxplot/level')
def boxplot_level():
    return jsonify(level_boxplot())


@app.route('/boxplot/deep')
def boxplot_deep():
    return jsonify(deep_boxplot())


@app.route('/line')
def line():
    return jsonify(month_line())


@app.route('/pie/month')
def pie_month():
    return jsonify(month_count_pie())


@app.route('/pie/level')
def pie_level():
    return jsonify(level_pie())


@app.route('/bar')
def bar():
    return jsonify(level_bar())


if __name__ == '__main__':
    app.run()
